package com.shopmall.common.exception;

import com.shopmall.common.ResponseData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public ResponseData exception(Exception exception){
        exception.printStackTrace();
        return new ResponseData("500",exception.getMessage(),null);
    }
}
